<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>教师管理平台</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-table.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/metisMenu.min.css">
    <link rel="stylesheet" href="css/common.css">

    <!--[if lt IE9] >
   <script type="text/javascript" src="js/html5.js"></script>
   <script type="text/javascript" src="js/placeholder-1.0.min.js"></script>
   <![endif]-->
</head>
<body>
<div class="common-left">
    <div class="common-left-title c-p-b-b">
        <small>PAGES</small>
        <h4>修改密码</h4>
    </div>
    <div class="common-nav" >

        <nav class="sidebar-nav">
            <ul id="menu">
                <li >
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">学校信息</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li >
                            <a href="./grade.html">
                                年级信息
                            </a>
                        </li>
                        <li>
                            <a href="./b-xinxi.html">
                                班级信息
                            </a>
                        </li>
                    </ul>
                </li>
                <li >
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">学生信息</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li >
                            <a href="./student-xinxi.html">
                                学生信息
                            </a>
                        </li>

                    </ul>
                </li>
                <li >
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">体育成绩</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li >
                            <a href="./tiyuxiangmu.html">
                                体育项目
                            </a>
                        </li>
                        <li>
                            <a href="./tiyuchengji.html">
                                体育成绩
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">班级动态</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li >
                            <a  class="on" href="./b-xiangce.html">
                                班级相册
                            </a>
                        </li>
                        <li>
                            <a href="./yanbodating.html">
                                演播大厅
                            </a>
                        </li>
                    </ul>
                </li>
                <li >
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">教师信息</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li >
                            <a href="./teacher.html">
                                教师信息
                            </a>
                        </li>
                        <li>
                            <a href="./pai-moban.html">
                                排课模板
                            </a>
                        </li>
                        <li>
                            <a href="./pai-xinxi.html">
                                排课信息
                            </a>
                        </li>
                        <!--<li>-->
                            <!--<a href="./myclass.html">-->
                                <!--我的课程-->
                            <!--</a>-->
                        <!--</li>-->
                    </ul>
                </li>
                <li class="active">
                    <a href="javascript:;">
                        <span class="sidebar-nav-item">系统设置</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="collapse" >
                        <li>
                            <a class="on" href="./password.html">
                                修改密码
                            </a>
                        </li>
                    </ul>
                </li>

            </ul>
        </nav>

    </div>
</div>
<div class="common-top">
    <div class="row">
        <div class="col-md-3 c-p-t">
            <img src="./images/logo.png" alt="">
        </div>
       <div class="common-top-title col-md-3 c-p-f-white">
            <a href="javascript:;">
                系统设置</a> >> <a href="javascript:;">修改密码</a>
        </div>
        <div class="col-md-6 text-right c-p-t">
            <a href="./login.html" class="btn btn-default">退出</a>
        </div>
    </div>
</div>
<div class="common-main">
    <div class="wrapper">
        <div class="container-fluid">
            <div class="row c-p-m-b c-p-t-l">
                <label class="col-md-2 text-right c-p-t" >请输入原始密码：</label>
                <div class="col-md-5">
                    <input type="password" class="form-control" id="old_passWord">
                </div>
                <div class="col-md-5 c-p-t text-danger">
                    请填写原来的密码
                </div>

            </div>
            <div class="row c-p-m-b">
                <label class="col-md-2 text-right c-p-t" >新密码：</label>
                <div class="col-md-5">
                    <input type="password" class="form-control" id="new_passWord">
                </div>
                <div class="col-md-5 c-p-t text-danger">
                   请输入8-20位由数字、字母、下划线组成的密码
                </div>

            </div>
            <div class="row c-p-m-b">
                <label class="col-md-2 text-right c-p-t" >再次确认新密码：</label>
                <div class="col-md-5">
                    <input type="password" class="form-control" id="confirm_passWord">
                </div>
                <div class="col-md-5 c-p-t text-danger">
                    请确保和刚输入的新密码一致
                </div>

            </div>
            <div class="row">
                <div class="col-md-5 col-sm-offset-4">
                    <a class="btn btn-primary" href="javascript:;" onclick="updatePassword()">提交</a>
                </div>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/metisMenu.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"> </script>
<script type="text/javascript" src="js/layer.js"></script>
<script type="text/javascript" src="js/laydate.js"></script>
<script type="text/javascript" src="js/jquery.nicescroll.min.js"></script>
<script type="text/javascript"  src="js/bootstrap-table.min.js"></script>
<script  type="text/javascript" src="js/bootstrap-table-mobile.min.js"></script>
<script  type="text/javascript" src="js/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/manager/config.js"></script>
<script type="text/javascript">
    function updatePassword() {
        var oldPassWord = $("#old_passWord").val();
        var newPassWord = $("#new_passWord").val();
        var confirmPassWord = $("#confirm_passWord").val();
        var reg = /^\w{8,12}$/;
        if (reg.test(newPassWord)) {
            if(newPassWord!=confirmPassWord)
            {
                layer.msg("两次密码输入不一致");
            }
            else {
                $.DemoPost("/sysUser/updatePassWord?token="+sessionStorage.getItem("token"),
                    {"passWord":newPassWord,"oldPassWord":oldPassWord},
                function (data) {
                    if(data.success)
                    {
                        $("#old_passWord").val("");
                        $("#new_passWord").val("");
                        $("#confirm_passWord").val("");
                    }
                     layer.msg(data.msg);

                },function (e) {
                        layer.msg("密码修改失败");
                    });
            }
        }
        else {
            layer.msg("请输入8-20位由数字、字母、下划线组成的密码");
        }
    }
</script>

</body>
</html>